Skip to content

Instantly share code, notes, and snippets.

@omarmiatello
omarmiatello / RssRequest.java
Last active February 27, 2016 14:00
RssRequest for Volley (Android lib)
/**
* Copyright 2013 Omar Miatello - omar.miatello@justonetouch.it
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@plentz
plentz / nginx.conf
Last active April 12, 2026 18:03
Best nginx configuration for improved security(and performance)
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
@ryansechrest
ryansechrest / post-receive.sh
Last active February 12, 2017 12:41
Git post-receive hook to deploy WordPress and plugins as submodules. It can also install Node.js modules with npm and vendor packages with Composer.
#!/bin/bash
# Created on 7/17/13 by Ryan Sechrest
# Deploys pushed branch from the origin repository to the web directory
if [[ (-n $1) && (-n $2) && (-n $3) ]]; then
# Set path to project directory
project_path="/var/www/domains/$2/$3"
@kevin-smets
kevin-smets / iterm2-solarized.md
Last active April 14, 2026 22:54
iTerm2 + Oh My Zsh + Solarized color scheme + Source Code Pro Powerline + Font Awesome + [Powerlevel10k] - (macOS)

Default

Default

Powerlevel10k

Powerlevel10k

@orta
orta / Makefile
Created February 21, 2014 23:35
Artsy iOS makefile
WORKSPACE = Artsy.xcworkspace
SCHEME = Artsy
CONFIGURATION = Beta
APP_PLIST = Artsy/App/Art.sy-Info.plist
BUNDLE_ID = net.artsy.artsy.beta
PLIST_BUDDY = /usr/libexec/PlistBuddy
BUNDLE_VERSION = $(shell $(PLIST_BUDDY) -c "Print CFBundleVersion" $(APP_PLIST))
GIT_COMMIT = $(shell git log -n1 --format='%h')
ALPHA_VERSION = $(BUNDLE_VERSION)-$(BUILD_NUMBER)-$(GIT_COMMIT)
@meng-hui
meng-hui / resize_icons.rb
Last active November 14, 2017 15:17
Populate a Unity generated Xcode project with all icons for a Universal build from a single icon file. In the folder with the xcode project, execute this script and by default looks for a file named icon_1024x1024.png and places all the icons needed into Unity-iPhone/Images.xcassets/AppIcon.appiconset/ . Requires gd and fastimage_resize gem
#!/usr/bin/env ruby
# make sure you have gd and fastimage_resize
# brew install gd
# sudo gem install fastimage_resize
require 'fastimage_resize'
require 'optparse'
require 'json'
require 'fileutils'
@bigmonkeyboy
bigmonkeyboy / README.md
Last active April 22, 2023 22:08 — forked from juzam/Node_Red Init
init.d script for Node-RED

This gist creates an init.d script to automatically run Node-RED at boot time.

To run it as a single step you can cut paste the following single line command

sudo wget -O /tmp/download https://gist.github.com/bigmonkeyboy/9962293/download && sudo tar -zxf /tmp/download --strip-components 1 -C /etc/init.d && sudo chmod 755 /etc/init.d/nodered && sudo update-rc.d nodered defaults

or click right-click "save as" this link - But please read the script first and satisfy yourself it's safe to execute in your environment...

@SegFaultAX
SegFaultAX / gist:10507478
Last active August 22, 2021 02:40
Dotted path expansion for Python dictionary keys
import operator
from pprint import pprint
def is_dict(d):
return isinstance(d, dict)
def get(c, k, default=None):
try:
return c[k]
except (IndexError, KeyError, TypeError):
import Foundation
extension String
{
var length: Int {
get {
return countElements(self)
}
}
@gmazzap
gmazzap / Controller.php
Last active December 28, 2024 16:23
WordPress plugin to ease the creation of virtual pages.
<?php
namespace GM\VirtualPages;
/**
* @author Giuseppe Mazzapica <giuseppe.mazzapica@gmail.com>
* @license http://opensource.org/licenses/MIT MIT
*/
class Controller implements ControllerInterface {
private $pages;