This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# Docker image to generate deterministic, verifiable builds of Anchor programs. | |
# This must be run *after* a given ANCHOR_CLI version is published and a git tag | |
# is released on GitHub. | |
# | |
FROM ubuntu:22.04 | |
ARG DEBIAN_FRONTEND=noninteractive |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { useEffect, useState } from 'react'; | |
import { Connection, PerfSample } from '@solana/web3.js'; | |
import { useAppConfig, useConnection } from '@shared/components-ui/contexts'; | |
import { Trans } from '@lingui/macro'; | |
const WarningIcon = () => { | |
return ( | |
<svg width="20" height="20" viewBox="0 0 20 21" fill="none" xmlns="http://www.w3.org/2000/svg"> | |
<path | |
fillRule="evenodd" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'stripe' | |
require 'ostruct' | |
# modified from: https://gist.github.com/jacobpatton/a68d228bf2414852d862 | |
# | |
# puts Stripe::Mrr.new(api_key: 'api_key').mrr | |
# | |
module Stripe | |
class Mrr | |
attr_reader :api_key |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# OS X install instructions http://www.reddit.com/r/linux/comments/a3snu/pianobar_is_a_command_line_client_for_pandora_no/c0fupws | |
brew install libao | |
# brew install libfaad2 # not available with brew, skipped and is working ok... | |
brew install libmad | |
brew install cmake # (this takes a while) | |
# install | |
git clone git://github.com/PromyLOPh/pianobar.git | |
cd pianobar |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Calculator | |
def evaluate statement | |
symbols = statement.split(' ') | |
puts calculate(symbols) | |
end | |
def calculate symbols | |
if symbols.length == 1 | |
return symbols[0] | |
else |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Pod::Spec.new do |s| | |
s.name = 'RestKit' | |
s.version = '0.10.3' | |
s.summary = 'RestKit is a framework for consuming and modeling RESTful web resources on iOS and OS X.' | |
s.homepage = 'http://www.restkit.org' | |
s.author = { 'Blake Watters' => 'blakewatters@gmail.com' } | |
s.source = { :git => 'https://github.com/siong1987/RestKit.git', :tag => 'v0.10.4' } | |
s.license = 'Apache License, Version 2.0' | |
s.source_files = 'Code/RestKit.h' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func personName(firstName: String, lastName: String?) -> String { | |
guard let lastName = lastName else { | |
return "\(firstName)" | |
} | |
return "\(firstName) \(lastName)" | |
} | |
personName("Siong", lastName: "Ong") // prints "Siong Ong" | |
personName("Siong", lastName: nil) // prints "Siong" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'benchmark' | |
require 'yab62' | |
def generate_token(length) | |
(1..length).collect { (i = Kernel.rand(62); i += ((i < 10) ? 48 : ((i < 36) ? 55 : 61 ))).chr }.join | |
end | |
def generate_mod_token(length) | |
(rand(62**length)).encode62.rjust(length,rand(62).encode62) | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(document).ready -> | |
routes = | |
"": | |
"NavbarRouter": "index" | |
"ListsRouter": "index" | |
"lists/:id": | |
"NavbarRouter": "index" | |
"ListsRouter": "show" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace :db do | |
namespace :copy do | |
def get_mongohq_url(env) | |
"mongohq_url" | |
end | |
def parse_mongodb_url(url) | |
uri = URI.parse(url) | |
[ uri, uri.path.gsub("/", "") ] |
NewerOlder