(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.
#!/bin/bash | |
function jsonval { | |
temp=`echo $json | sed 's/\\\\\//\//g' | sed 's/[{}]//g' | awk -v k="text" '{n=split($0,a,","); for (i=1; i<=n; i++) print a[i]}' | sed 's/\"\:\"/\|/g' | sed 's/[\,]/ /g' | sed 's/\"//g' | grep -w $prop` | |
echo ${temp##*|} | |
} | |
json=`curl -s -X GET http://twitter.com/users/show/$1.json` | |
prop='profile_image_url' | |
picurl=`jsonval` |
#!/bin/bash | |
# using, | |
# | |
# ./logrotatecat access.log | |
# | |
# inside a directory of log rotate logs in a form like | |
# | |
# access.log | |
# access.log.1 |
// Continuously changing GIST of UIWebView 'tweaks' I use. Might be useful to others, | |
// hope Google finds this. Some of these already passed Review, but one never knows ;). | |
// Happy coding! | |
- (void)ScrollView_setContentOffset:(CGPoint)offset { | |
// Prevent superfluous scrolling animations (eg when toggling keyboard) by completely disabling scrolling. We achieve scrolling through inner scroll views (overflowing html elements). | |
} | |
- (id)WebBrowserView_inputAccessoryView { | |
// Make the keyboard accessory view (next/prev,submit buttons) optional, it really takes up to much screen estate in a normal app. |
#!/bin/bash | |
# | |
# rotate_desktop.sh | |
# | |
# Rotates modern Linux desktop screen and input devices to match. Handy for | |
# convertible notebooks. Call this script from panel launchers, keyboard | |
# shortcuts, or touch gesture bindings (xSwipe, touchegg, etc.). | |
# | |
# Using transformation matrix bits taken from: | |
# https://wiki.ubuntu.com/X/InputCoordinateTransformation |
(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.
NSString *const PSPDFApplicationDidReceiveMemoryWarningNotification = @"PSPDFApplicationDidReceiveMemoryWarningNotification"; | |
// Test with sudo memory_pressure -l critical. Don't forget to re-set afterwards! | |
__attribute__((constructor)) static void PSPDFInstallLowMemoryNotificationWarningMac(void) { | |
static dispatch_source_t source; | |
static dispatch_once_t onceToken; | |
dispatch_once(&onceToken, ^{ | |
source = dispatch_source_create(DISPATCH_SOURCE_TYPE_MEMORYPRESSURE, 0, DISPATCH_MEMORYPRESSURE_WARN|DISPATCH_MEMORYPRESSURE_CRITICAL, dispatch_get_main_queue()); | |
dispatch_source_set_event_handler(source, ^{ | |
dispatch_source_memorypressure_flags_t pressureLevel = dispatch_source_get_data(source); |
{ | |
"name": "securehelloworld", | |
"version": "1.0.0", | |
"description": "", | |
"main": "server.js", | |
"scripts": { | |
"test": "echo \"Error: no test specified\" && exit 1" | |
}, | |
"author": "", | |
"license": "ISC", |
Note for newcomers: | |
In the shortcuts below, "C" stands for CTRL and "A" stands for "ALT". This is a convention | |
used in the Midnight Commander documentation and was kept here. | |
You can also use "ESC" instead of "ALT", which is useful on Macbooks. | |
Main View | |
--------------------------------------------------------------- | |
- File/directory operations |
#include <stdio.h> | |
#include <locale.h> | |
#include <X11/Xlib.h> | |
#include <X11/keysym.h> | |
int main(void){ | |
setlocale(LC_ALL, ""); | |
Display* dpy = XOpenDisplay(NULL); |
#include <stdint.h> | |
/** | |
* Encode a code point using UTF-8 | |
* | |
* @author Ondřej Hruška <ondra@ondrovo.com> | |
* @license MIT | |
* | |
* @param out - output buffer (min 5 characters), will be 0-terminated | |
* @param utf - code point 0-0x10FFFF |