Skip to content

Instantly share code, notes, and snippets.

View Lesmiscore's full-sized avatar
💭
🤔

Lesmiscore Lesmiscore

💭
🤔
  • なぞのばしょ
  • Mystery Zone, Pokémon
View GitHub Profile
@seraphy
seraphy / RSASample.java
Created July 5, 2012 14:09
JAVAにおける、RSAによるキー交換とAES暗号化・複合化(CBC/IVあり)のサンプル
package rsasample;
import java.io.ByteArrayOutputStream;
import java.math.BigInteger;
import java.security.Key;
import java.security.KeyFactory;
import java.security.KeyPair;
import java.security.KeyPairGenerator;
import java.security.interfaces.RSAPrivateKey;
@robwierzbowski
robwierzbowski / gitcreate.sh
Last active August 13, 2024 19:57
A simple litte script. Create and push to a new github repo from the command line.
#!/bin/bash
# https://gist.github.com/robwierzbowski/5430952/
# Create and push to a new github repo from the command line.
# Grabs sensible defaults from the containing folder and `.gitconfig`.
# Refinements welcome.
# Gather constant vars
CURRENTDIR=${PWD##*/}
GITHUBUSER=$(git config github.user)
@dmarcato
dmarcato / strip_play_services.gradle
Last active December 21, 2022 10:10
Gradle task to strip unused packages on Google Play Services library
def toCamelCase(String string) {
String result = ""
string.findAll("[^\\W]+") { String word ->
result += word.capitalize()
}
return result
}
afterEvaluate { project ->
Configuration runtimeConfiguration = project.configurations.getByName('compile')
@manishk3008
manishk3008 / Android Persistent Cookies Store
Last active December 29, 2020 09:17
CookieStore for dealing with persistent cookies in Android
//HOW TO USE
SiCookieStore2 siCookieStore = new SiCookieStore2(context);
CookieManager cookieManager = new CookieManager((CookieStore) siCookieStore, CookiePolicy.ACCEPT_ALL);
CookieHandler.setDefault(cookieManager);
@GeertJohan
GeertJohan / DarkGravityWave3.cpp
Last active February 17, 2021 04:23
Dark Gravity Wave version 3
static const int64 nTargetSpacing = 2.5 * 60; // Guldencoin: 2.5 minutes between block
unsigned int static DarkGravityWave3(const CBlockIndex* pindexLast, const CBlockHeader *pblock) {
/* current difficulty formula, darkcoin - DarkGravity v3, written by Evan Duffield - [email protected] */
const CBlockIndex *BlockLastSolved = pindexLast;
const CBlockIndex *BlockReading = pindexLast;
const CBlockHeader *BlockCreating = pblock;
BlockCreating = BlockCreating;
int64 nActualTimespan = 0;
@rherrmann
rherrmann / GitInternalsLearningTest.java
Last active October 11, 2020 07:11
'Learning Tests' that use the JGit API to explore the internals of Git commits: http://www.codeaffine.com/2014/10/20/git-internals/
/***************************************************************************************************
* Copyright (c) 2014 Rüdiger Herrmann
* All rights reserved. This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Rüdiger Herrmann - initial API and implementation
**************************************************************************************************/
package com.codeaffine.jgit;
@eluleci
eluleci / Dockerfile
Last active August 8, 2023 07:57
Dockerfile for Android CI
############################################################
# Dockerfile to build Android project and use Jenkins CI
#
############################################################
FROM ubuntu:14.04
MAINTAINER eluleci <[email protected]>
RUN apt-get update
@nowri
nowri / file0.js
Last active August 29, 2015 14:27
GASで非共有Driveファイルのオーナー権限を変更する ref: http://qiita.com/nowri/items/2d33f9ba580da52c913c
var file = DriveApp.getFileById("FILE_ID_HERE");//自分がオーナーのファイル
var targetMail = "[email protected]";
var oldMail;
file.setOwner(targetMail);
oldMail = Session.getActiveUser().getEmail();
file.removeEditor(oldMail);
{
"name": "fish.pufferfish.raw",
"id": 206,
"icon": "fish_raw_puffer_fish",
"use_animation": "eat",
"use_duration": 32,
"max_damage": 0,
"stacked_by_data": true,
"food": {
@remko
remko / cue2ffmeta.rb
Last active April 21, 2022 13:48
Script to convert .cue files to FFMPEG metadata files
#!/usr/bin/env ruby
# Simple script to convert .cue files to FFMPEG Metadata files
# This can then be fed to ffmpeg to add chapters etc. to
# an MP4 or MKV file, e.g.
#
# ./cue2ffmeta.rb <FILE>.cue <TOTAL_LENGTH_IN_SECONDS> > metadata.txt
# ffmpeg -i <INPUT> -i metadata.txt -map_metadata 1 -codec copy <OUTPUT>
#
# (the TOTAL_LENGTH_IN_SECONDS is optional)