(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
| #!/usr/bin/env python2 | |
| # lrdcq | |
| # usage python2 unwxapkg.py filename | |
| import sys, os | |
| import struct | |
| class WxapkgFile(object): | |
| nameLen = 0 |
| Source: https://dba.stackexchange.com/questions/83125/mysql-any-way-to-import-a-huge-32-gb-sql-dump-faster | |
| innodb_buffer_pool_size = 4G | |
| innodb_log_buffer_size = 256M | |
| innodb_log_file_size = 1G | |
| innodb_write_io_threads = 16 | |
| innodb_flush_log_at_trx_commit = 0 | |
| Why these settings ? | |
| innodb_buffer_pool_size will cache frequently read data |
| #!/bin/bash | |
| sudo add-apt-repository ppa:chris-lea/libsodium; | |
| sudo echo "deb http://ppa.launchpad.net/chris-lea/libsodium/ubuntu trusty main" >> /etc/apt/sources.list; | |
| sudo echo "deb-src http://ppa.launchpad.net/chris-lea/libsodium/ubuntu trusty main" >> /etc/apt/sources.list; | |
| sudo apt-get update && sudo apt-get install libsodium-dev; |
| System process daemons that are system-wide provided by mac os x are described by launchd preference files that can be showed with the command: | |
| $ sudo ls -all /System/Library/LaunchDaemons/ | |
| Third party process daemons that are system-wide provided by the administrator are described by preference files that can be showed with the command: | |
| $ sudo ls -all /Library/LaunchDaemons/ | |
| Launch Agents that are per-user provided by mac os x usually loaded when the user logs in. Those provided by the system can be found with: | |
| $ sudo ls -all /System/Library/LaunchAgents/ | |
| Launch Agents that are per-user provided by the administrator and usually loaded when the user logs in. Those provided by the system can be found with: |
| /// Observes a run loop to detect any stalling or blocking that occurs. | |
| /// | |
| /// This class is thread-safe. | |
| @interface GHRunLoopWatchdog : NSObject | |
| /// Initializes the receiver to watch the specified run loop, using a default | |
| /// stalling threshold. | |
| - (id)initWithRunLoop:(CFRunLoopRef)runLoop; | |
| /// Initializes the receiver to detect when the specified run loop blocks for |
| Agnes en_US # Isn't it nice to have a computer that will talk to you? | |
| Albert en_US # I have a frog in my throat. No, I mean a real frog! | |
| Alex en_US # Most people recognize me by my voice. | |
| Alice it_IT # Salve, mi chiamo Alice e sono una voce italiana. | |
| Alva sv_SE # Hej, jag heter Alva. Jag är en svensk röst. | |
| Amelie fr_CA # Bonjour, je m’appelle Amelie. Je suis une voix canadienne. | |
| Anna de_DE # Hallo, ich heiße Anna und ich bin eine deutsche Stimme. | |
| Bad News en_US # The light you see at the end of the tunnel is the headlamp of a fast approaching train. | |
| Bahh en_US # Do not pull the wool over my eyes. | |
| Bells en_US # Time flies when you are having fun. |
| #pragma mark - Magic | |
| // Need for supporting orientation when not supported in host app plist. | |
| // Swizzle original -application:supportedInterfaceOrientationsForWindow: to change supported orientation in runtime. | |
| -(void) swizzleSupportedInterfaceOrientationsForWindow | |
| { | |
| Class applicationDelegateClass = [[UIApplication sharedApplication].delegate class]; | |
| Class sdkClass = [self class]; | |
| SEL originalSelector = @selector(application:supportedInterfaceOrientationsForWindow:); | |
| SEL swizzledSelector = @selector(las_application:supportedInterfaceOrientationsForWindow:); |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
| #define NSNullObjects @[@"",@0,@{},@[]] | |
| @interface NSNull (InternalNullExtention) | |
| @end | |
| @implementation NSNull (InternalNullExtention) | |
| var newWidth = 1280; | |
| $('.container').css('width', newWidth + 'px'); | |
| $('.repository-content').css('width', (newWidth - 60) + 'px'); |