Skip to content

Instantly share code, notes, and snippets.

View odemolliens's full-sized avatar

@odemolliens odemolliens

View GitHub Profile
@acdimalev
acdimalev / gem-depcheck
Created August 4, 2011 10:51
Check for uninstalled gem dependencies.
#!/usr/bin/ruby
require 'rubygems'
installed_gems = Gem::Dependency.new '', Gem::Requirement.default
missing = []
# mind the short-hand, looping over installed gem specs
specs = Gem.source_index.search installed_gems
specs.each do |spec|
gem = Gem::Dependency.new spec.name, spec.version
# looping over gem dependencies
specs = Gem.source_index.search gem
@AquaGeek
AquaGeek / NSCachedURLResponse+EncodingFix.m
Created October 7, 2011 18:49
NSCachedURLResponse and NSKeyedArchiver issue
@implementation NSCachedURLResponse(HackityHack)
- (id)initWithCoder:(NSCoder *)aDecoder
{
return [self initWithResponse:[aDecoder decodeObjectForKey:@"response"]
data:[aDecoder decodeObjectForKey:@"data"]
userInfo:[aDecoder decodeObjectForKey:@"userInfo"]
storagePolicy:(NSURLCacheStoragePolicy)[aDecoder decodeIntForKey:@"storagePolicy"]];
}
@jexchan
jexchan / multiple_ssh_setting.md
Created April 10, 2012 15:00
Multiple SSH keys for different github accounts

Multiple SSH Keys settings for different github account

create different public key

create different ssh key according the article Mac Set-Up Git

$ ssh-keygen -t rsa -C "your_email@youremail.com"
@leovandriel
leovandriel / gist:3775603
Created September 24, 2012 11:53
Xcode Run Script for building static framework for Cocoa Touch iOS
# Xcode Run Script for building iOS static framework.
# Requires a preconfigured Cocoa Touch Static Library.
# Usage:
# 1. Open project > Add Target > iOS Aggregate > Finish
# 2. Add Build Phase > Add Run Script > Paste
# 3. Manually assign PROJECT, TARGET, HEADERS, PRODUCT, OUTPUT
# 4. Run outputs to ${SRCROOT}/build
#
# License: Public Domain
# Author: Leonard van Driel, 2012
@suda
suda / multipleRows.mm
Last active June 14, 2019 09:06
Multiple Row Selection in UIPickerView
- (UIView *)pickerView:(UIPickerView *)pickerView viewForRow:(NSInteger)row forComponent:(NSInteger)component reusingView:(UIView *)view {
UITableViewCell *cell = (UITableViewCell *)view;
if (cell == nil) {
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:nil];
[cell setBackgroundColor:[UIColor clearColor]];
[cell setBounds:CGRectMake(0, 0, cell.frame.size.width - 20, 44)];
cell.tab = row UITapGestureRecognizer * singleTapGestureRecognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(toggleSelection:)];
singleTapGestureRecognizer.numberOfTapsRequired = 1;
[cell addGestureRecognizer:singleTapGestureRecognizer];
}
@mralexgray
mralexgray / codesign-frameworks.sh
Created May 12, 2013 12:27
CODE_SIGN_IDENTITY for Frameworks!!
#!/bin/sh
# WARNING: You may have to run Clean in Xcode after changing CODE_SIGN_IDENTITY!
# Verify that $CODE_SIGN_IDENTITY is set
if [ -z "$CODE_SIGN_IDENTITY" ] ; then
echo "CODE_SIGN_IDENTITY needs to be non-empty for codesigning frameworks!"
if [ "$CONFIGURATION" = "Release" ] ; then
exit 1
@bichotll
bichotll / load_disqus_comments_android.java
Last active April 25, 2019 15:19
Load disqus comments with a htmlview in Android
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_comments);
String htmlComments = getHtmlComment("yourId", "yourShortName");
webDisqus = (WebView) findViewById(R.id.disqus);
// set up disqus
WebSettings webSettings2 = webDisqus.getSettings();
@alexjlockwood
alexjlockwood / MainActivity.java
Last active August 12, 2020 12:06
Sample usage of the "android.app.Application.ActivityLifecycleCallbacks" class.
public class MainActivity extends Activity {
private final MyActivityLifecycleCallbacks mCallbacks = new MyActivityLifecycleCallbacks();
@Override
protected void onCreate(Bundle savedInstanceState) {
// Always register before calling into the super class.
getApplication().registerActivityLifecycleCallbacks(mCallbacks);
super.onCreate(savedInstanceState);
@marianposaceanu
marianposaceanu / linux_fun.md
Last active January 29, 2023 20:31
How to have some fun using the terminal.

Linux fun-o-matic

How to have some fun using the terminal.

  1. Install cowsay [0] via : sudo apt-get install cowsay
  2. Install fortune [1] via : sudo apt-get install fortune
  3. Make sure you have Ruby installed via : ruby -v
  4. Install the lolcat [2] via : gem gem install lolcat
  5. Profit!
@jonasbits
jonasbits / xeger.py
Created December 23, 2013 20:33
vanitygen bitcoin regex is possible, but oclvanitygen does not have this option... so i have to make a list
comment = '''1L1ddeLL
1L1dd3LL
1L1ddELL
1L1dDeLL
1L1dD3LL
1L1dDELL
1L1DdeLL
1L1Dd3LL
1L1DdELL
1L1DDeLL