Skip to content

Instantly share code, notes, and snippets.

@ryosebach
ryosebach / CustomItemBlock.java
Last active April 18, 2016 23:07
[minecraft][Forge] ItemとBlockに情報を付与する [modding] ref: http://qiita.com/ryosebach/items/3f1f19b6281a33d5d203
@SideOnly(Side.CLIENT)
public class CustomItemBlock extends ItemBlock
{
public CustomItemBlock(Block block)
{
super(block);
}
public void addInformation(ItemStack itemstack, EntityPlayer player, List list, boolean par4)
{
@subhaze
subhaze / JavaScript NG.sublime-syntax
Last active September 29, 2023 14:58
very start of Angular 2 sublime syntax file
%YAML 1.2
---
# See http://www.sublimetext.com/docs/3/syntax.html
name: JavaScript NG
file_extensions:
- js
- ng.js
scope: source.js.ng
contexts:
main:
@williewillus
williewillus / primer.md
Last active December 20, 2020 08:13
1.8.9 to 1.9 quick primer
<?xml version="1.0" ?>
<systemList>
<system>
<fullname>Sega Mega Drive / Genesis</fullname>
<name>megadrive-dgen</name>
<path>~/RetroPie/roms/megadrive-dgen</path>
<extension>.smd .SMD .bin .BIN .gen .GEN .md .MD .zip .ZIP</extension>
<command>/opt/retropie/supplementary/runcommand/runcommand.sh 0 "/opt/retropie/emulators/dgen/bin/dgen -f -r /opt/retropie/configs/all/dgenrc %ROM%" "dgen"</command>
<platform>genesis,megadrive</platform>
<theme>megadrive</theme>
@freimanas
freimanas / tweet_image_dumper.py
Last active March 29, 2022 22:37
Get twitter user's photo url's from tweets - download all images from twitter user
#!/usr/bin/env python
# encoding: utf-8
import tweepy #https://github.com/tweepy/tweepy
import csv
import sys
#Twitter API credentials
consumer_key = ""
consumer_secret = ""
@ashblue
ashblue / normalize-slope.cs
Last active December 11, 2024 18:51
Unity 2D slope normalizer for walking up and downhill with corner snapping. Based upon https://www.youtube.com/watch?v=xMhgxUFKakQ
// @NOTE Must be called from FixedUpdate() to work properly
void NormalizeSlope () {
// Attempt vertical normalization
if (grounded) {
RaycastHit2D hit = Physics2D.Raycast(transform.position, -Vector2.up, 1f, whatIsGround);
if (hit.collider != null && Mathf.Abs(hit.normal.x) > 0.1f) {
Rigidbody2D body = GetComponent<Rigidbody2D>();
// Apply the opposite force against the slope force
// You will need to provide your own slopeFriction to stabalize movement
@andrewmurray
andrewmurray / gist:b63b7592386cb67124d1
Last active February 14, 2024 12:17
Convert an Epplus ExcelPackage to a CSV file, returning the byte[] array of this new CSV file. Taking the code provided by "Brad" at http://codejournal.blogspot.co.uk/2012/03/using-epplus-library-to-convert-xlsx-to.html and creating an extension method from it which can be called on Epplus' ExcelPackage. Just call excelPackageObject.ConvertToCsv();
using OfficeOpenXml;
using System.Collections.Generic;
using System.IO;
using System.Text;
namespace WebUI.Infrastructure
{
public static class StringUtils
{
private static string DuplicateTicksForSql(this string s)
@boboldehampsink
boboldehampsink / ios_disable_push_notifications.js
Created March 17, 2015 15:11
Cordova - after_platform_add hook to disable push notifications code
#!/usr/bin/env node
var GCC_PREPROCESSOR_DEFINITIONS = '"$(inherited) DISABLE_PUSH_NOTIFICATIONS=1"';
var fs = require("fs");
var path = require("path");
var xcode = require('xcode');
var projectRoot = process.argv[2];
function getProjectName(protoPath) {
@EddyVerbruggen
EddyVerbruggen / cordova-ios-3.7.0-handleopenurl-fix
Last active August 29, 2015 14:10
Cordova iOS 3.7.0 handleOpenURL coldstart fix
// I'm not saying this is the best solution, it's just a temp fix which works in my case to solve
// the issue where a passed in url is not propagated to the handleOpenURL js function upon
// coldstart on iOS Cordova 3.7.0.
// Stay tuned on this issue for a better fix: https://issues.apache.org/jira/browse/CB-7606
// replace processOpenUrl in CDVViewController.m by this:
- (void)processOpenUrl:(NSURL*)url pageLoaded:(BOOL)pageLoaded
{
NSString* readyState = [webView stringByEvaluatingJavaScriptFromString:@"document.readyState"];
@rolftimmermans
rolftimmermans / compress-folder-with-tinypng.jsx
Created June 25, 2014 14:24
Compressing all PNG images in a folder and its subfolders with TinyPNG
#target photoshop
/* Open the given file, and compress with TinyPNG. */
function compressFile(file) {
var document = open(file);
if (document.mode == DocumentMode.INDEXEDCOLOR) {
document.changeMode(ChangeMode.RGB);
}