Skip to content

Instantly share code, notes, and snippets.

@madan712
madan712 / NumberToWordsConverter.java
Last active September 18, 2023 04:02
Java program to convert numbers to words
import java.text.NumberFormat;
public class NumberToWordsConverter {
public static final String[] units = { "", "One", "Two", "Three", "Four",
"Five", "Six", "Seven", "Eight", "Nine", "Ten", "Eleven", "Twelve",
"Thirteen", "Fourteen", "Fifteen", "Sixteen", "Seventeen",
"Eighteen", "Nineteen" };
public static final String[] tens = {
# Before Script
before_script:
- composer self-update
- composer install --prefer-dist > /dev/null
- cp .env.example .env
- php artisan key:generate
- php artisan migrate:refresh
# Services
services:
@danverbraganza
danverbraganza / hangman.py
Last active April 20, 2017 18:52
Hangman implemented in 3 lines of Python! For an explanation of how this works, see http://danverbraganza.com/writings/hangman-in-3-lines-of-python
license, chosen_word, guesses, scaffold, man, guesses_left = 'https://opensource.org/licenses/MIT', ''.join(filter(str.isalpha, __import__('random').choice(open('/usr/share/dict/words').readlines()).upper())), set(), '|======\n| |\n| {3} {0} {5}\n| {2}{1}{4}\n| {6} {7}\n| {8} {9}\n|', list('OT-\\-//\\||'), 10
while not all(letter in guesses for letter in chosen_word) and guesses_left: _, guesses_left = map(guesses.add, filter(str.isalpha, raw_input('%s(%s guesses left)\n%s\n%s:' % (','.join(sorted(guesses)), guesses_left, scaffold.format(*(man[:10-guesses_left] + [' '] * guesses_left)), ' '.join(letter if letter in guesses else '_' for letter in chosen_word))).upper())), max((10 - len(guesses - set(chosen_word))), 0)
print 'You', ['lose!\n' + scaffold.format(*man), 'win!'][bool(guesses_left)], '\nWord was', chosen_word
@HoverBaum
HoverBaum / .gitlab-ci.yml
Created May 20, 2016 09:12
Gulpfile and gitlab CI config to go with my Hexo based blog.
image: node:4.2.2
pages:
cache:
paths:
- node_modules/
script:
- npm install -g gulp
- npm install

Keybase proof

I hereby claim:

  • I am jivdhaliwal on github.
  • I am jiv (https://keybase.io/jiv) on keybase.
  • I have a public key whose fingerprint is 5787 3F61 2728 DAB4 07D4 FEFB 7139 C265 8E62 8B4C

To claim this, I am signing this object:

@SpEcHiDe
SpEcHiDe / img2pdf.tex
Last active July 4, 2017 11:08
LaTeX file to convert image to portable document format
\documentclass[12pt,a4paper]{report}
\usepackage[pdftex]{graphicx}
\usepackage[pdfborder={0 0 0}, pdftitle={<pdf title here>}, pdfauthor={<author's name here>}, pdfsubject={<subject here>}, pdfkeywords={<keywords here>}]{hyperref}
\pagenumbering{gobble}
\begin{document}
\includegraphics[scale=0.65,angle=0]{./file_name} % the image file name without extension
\end{document}
@fstab
fstab / MATRIX.md
Last active January 5, 2022 12:31
How to use matrix.org and vector.im as an IRC client

How to use matrix.org and vector.im as an IRC client

How to Join an IRC Channel on matrix.org

Join the room #freenode_<#channel>:matrix.org, replacing <#channel> with the name of the IRC channel. For example, in order to join the #prometheus IRC channel, join the room #freenode_#prometheus:matrix.org on matrix.org.

In vector.im, rooms can be joined with the directory symbol on the bottom left.

@avafloww
avafloww / PhpJava.java
Last active April 1, 2025 18:01
This snippet of code is syntactically valid in both PHP and Java, and produces the same output in both.
/*<?php
//*/public class PhpJava { public static void main(String[] args) { System.out.printf("/*%s",
//\u000A\u002F\u002A
class PhpJava {
static function main() {
echo(//\u000A\u002A\u002F
"Hello World!");
}}
//\u000A\u002F\u002A
PhpJava::main();
@AbdealiLoKo
AbdealiLoKo / 00 - Intro to Jupyter.ipynb
Created September 24, 2016 10:24
WIkimedia Hackathon - Bits Pilani Hyderabad Campus
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@Arinerron
Arinerron / permissions.txt
Last active May 6, 2025 18:23
A list of all Android permissions...
android.permission.ACCESS_ALL_DOWNLOADS
android.permission.ACCESS_BLUETOOTH_SHARE
android.permission.ACCESS_CACHE_FILESYSTEM
android.permission.ACCESS_CHECKIN_PROPERTIES
android.permission.ACCESS_CONTENT_PROVIDERS_EXTERNALLY
android.permission.ACCESS_DOWNLOAD_MANAGER
android.permission.ACCESS_DOWNLOAD_MANAGER_ADVANCED
android.permission.ACCESS_DRM_CERTIFICATES
android.permission.ACCESS_EPHEMERAL_APPS
android.permission.ACCESS_FM_RADIO