Skip to content

Instantly share code, notes, and snippets.

View wiyarmir's full-sized avatar
:shipit:
🚢

Guillermo Orellana wiyarmir

:shipit:
🚢
View GitHub Profile
@wiyarmir
wiyarmir / symfonyrc
Created January 25, 2016 10:47
Script to configure automatically an alias to Symfony console with version 3.0 and earlies
#!/bin/bash
# Comment this if you won't display the symfony version and environment
export SYMFONYRC_DISPLAY_VERSION=1
# Execute 'sfenv' to change the default environment
function sfenv()
{
case $1 in
prod|dev|test )
Verifying that +wiyarmir is my blockchain ID. https://onename.com/wiyarmir
@wiyarmir
wiyarmir / generated.java
Created October 18, 2016 09:36
Lombok generated
public final class ValueExample {
private final String name;
private final int age;
private final double score;
protected final String[] tags;
public ValueExample(String name, int age, double score, String[] tags) {
this.name = name;
this.age = age;
this.score = score;

Keybase proof

I hereby claim:

  • I am wiyarmir on github.
  • I am wiyarmir (https://keybase.io/wiyarmir) on keybase.
  • I have a public key whose fingerprint is 6A57 81BF 36AE 9A83 AB1D 4F11 D102 810D D68D 2B66

To claim this, I am signing this object:

@wiyarmir
wiyarmir / BuildTracker.groovy
Created May 11, 2017 10:42
Track your gradle build times
class BuildTracker {
private static final String STATS_SRV = ""
static void addBuildSpeedTracking(gradle) {
if (true) return
def startTime = System.currentTimeMillis()
gradle.buildFinished { buildResult ->
def time = System.currentTimeMillis() - startTime
private String currentLocale;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
currentLocale = getResources().getConfiguration().locale.toString();
}
@Override
public void onConfigurationChanged(Configuration newConfig) {
BEGIN MESSAGE.
MygZeiLYYaF9gVD oMFgiA0IkpmM2A4 WvsBAphq1iToPLl wdInJb9OZ5ZgJdR
8zz9shMbyOdX2hK g8oBkGyLvbGTCKq 6Xr2MZHgg6IHBoR vM0DQhKB74hY6ZH
7Pk71GKIUPwdp4H OUNR1VNeqvxM4DR GCFZE3kl6ujIhxY eJZUIkcO2cgzrs9
R1ZJSiTyyMCCgnL 4yVmqD7qlX1AzuE ek3RF0Qz5Z.
END MESSAGE.
const newKeypair = Keypair.fromSeed(seed)
const associatedSource = await getAssociatedTokenAddress(usdcPublicKey, walletPublicKey)
const associatedNew = await getAssociatedTokenAddress(usdcPublicKey, newKeypair.publicKey)
const mint = await getMint(connection, usdcPublicKey)
const receiverAccount = await connection.getAccountInfo(associatedNew)
const instructions: TransactionInstruction[] = []
instructions.push(createAssociatedTokenAccountInstruction(walletPublicKey, associatedNew, walletPublicKey, usdcPublicKey))