Skip to content

Instantly share code, notes, and snippets.

@zxx
zxx / redis_cheatsheet.bash
Created December 14, 2019 03:40 — forked from LeCoupa/redis_cheatsheet.bash
Redis Cheatsheet - Basic Commands You Must Know --> UPDATED VERSION --> https://github.com/LeCoupa/awesome-cheatsheets
# Redis Cheatsheet
# All the commands you need to know
redis-server /path/redis.conf # start redis with the related configuration file
redis-cli # opens a redis prompt
# Strings.
@zxx
zxx / iterm2-solarized.md
Created May 14, 2019 12:19 — forked from kevin-smets/iterm2-solarized.md
iTerm2 + Oh My Zsh + Solarized color scheme + Meslo powerline font + [Powerlevel9k] - (macOS)

Default

Default

Powerlevel9k

Powerlevel9k

@zxx
zxx / AbstractDb.java
Created March 20, 2019 13:24 — forked from abender/AbstractDb.java
A simple Android SQLite template to use databases. The example table holds information about users and their corresponding password. (It's only an example to show the usage so the passwords aren't encrypted by the sample code.)
package de.databasetemplate.db;
import java.util.HashMap;
import java.util.Map;
import android.content.ContentValues;
import android.content.Context;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.util.Log;
@zxx
zxx / Apple push notification
Created August 29, 2018 09:30 — forked from netoxico/Apple push notification
Apple push notification with python
#!/usr/bin/env python
import ssl
import json
import socket
import struct
import binascii
def send_push_message(token, payload):
# the certificate file generated from Provisioning Portal
@zxx
zxx / vlc
Created August 31, 2017 04:33 — forked from kgriffs/vlc
Run VLC from the command line on Mac OS X and stream internet radio (such as Radio Paradise).
#!/usr/bin/env bash
/Applications/VLC.app/Contents/MacOS/VLC -I rc "$@"
ACTION = build
AD_HOC_CODE_SIGNING_ALLOWED = NO
ALTERNATE_GROUP = staff
ALTERNATE_MODE = u+w,go-w,a+rX
ALTERNATE_OWNER = grantdavis
ALWAYS_SEARCH_USER_PATHS = NO
ALWAYS_USE_SEPARATE_HEADERMAPS = YES
APPLE_INTERNAL_DEVELOPER_DIR = /AppleInternal/Developer
APPLE_INTERNAL_DIR = /AppleInternal
APPLE_INTERNAL_DOCUMENTATION_DIR = /AppleInternal/Documentation
@zxx
zxx / Install_tmux
Last active January 14, 2017 04:50 — forked from simme/Install_tmux
Install and configure tmux on Mac OS X
# First install tmux
brew install tmux
# For mouse support (for switching panes and windows)
# Only needed if you are using Terminal.app (iTerm has mouse support)
Install http://www.culater.net/software/SIMBL/SIMBL.php
Then install https://bitheap.org/mouseterm/
# More on mouse support http://floriancrouzat.net/2010/07/run-tmux-with-mouse-support-in-mac-os-x-terminal-app/
@zxx
zxx / xcodeproj_build.rb
Created November 29, 2016 01:00 — forked from onevcat/xcodeproj_build.rb
Example of using xcodeproj
require_relative "../config.rb"
gem 'xcodeproj', '>=0.19.4'
require 'xcodeproj'
PROJECT = 'Unity-iPhone'
TARGET = 'Unity-iPhone'
LIBRARY = 'Libraries'
### Export
def exportUnityProject
@zxx
zxx / qsort.swift
Created November 29, 2016 00:59 — forked from onevcat/qsort.swift
Quick sort of Swift
//: Playground - noun: a place where people can play
import UIKit
var randomNumbers = [42, 12, 88, 62, 63, 56, 1, 77, 88, 97, 97, 20, 45, 91, 62, 2, 15, 31, 59, 5]
func partition(inout v: [Int], left: Int, right: Int) -> Int {
var i = left
for j in (left + 1) ... right {
if v[j] < v[left] {
@zxx
zxx / NSShadow Example
Created May 4, 2016 09:33 — forked from peerasak-u/NSShadow Example
NSShadow Example
NSShadow *textShadow = [[NSShadow alloc] init];
textShadow.shadowColor = [UIColor darkGrayColor];
textShadow.shadowBlurRadius = 1.2;
textShadow.shadowOffset = CGSizeMake(1,1);
NSDictionary *attributes = @{NSForegroundColorAttributeName: [UIColor blackColor],
NSShadowAttributeName: textShadow
};