This file contains hidden or 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
| git log # select sha of commit | |
| git rebase -i <sha> | |
| git push --force |
This file contains hidden or 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
| Java Syntax Specification | |
| Programs | |
| <compilation unit> ::= <package declaration>? <import declarations>? <type declarations>? | |
| Declarations | |
| <package declaration> ::= package <package name> ; | |
| <import declarations> ::= <import declaration> | <import declarations> <import declaration> |
This file contains hidden or 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
| @Echo Off | |
| :: Варианит 1 | |
| Set xOS=x64 | |
| If "%PROCESSOR_ARCHITECTURE%"=="x86" If Not Defined PROCESSOR_ARCHITEW6432 Set xOS=x86 | |
| Echo %xOS% | |
| Pause | |
| :: =================================================================================== | |
| :: Варианит 2 | |
| Set xOS=x86 |
This file contains hidden or 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
| <assembly> | |
| <id>dist</id> | |
| <formats> | |
| <format>zip</format> | |
| </formats> | |
| <includeBaseDirectory>true</includeBaseDirectory> | |
| <dependencySets> | |
| <dependencySet> |
This file contains hidden or 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
| <plugin> | |
| <groupId>org.apache.maven.plugins</groupId> | |
| <artifactId>maven-antrun-plugin</artifactId> | |
| <executions> | |
| <execution> | |
| <phase>generate-resources</phase> | |
| <goals> | |
| <goal>run</goal> | |
| </goals> | |
| <configuration> |
This file contains hidden or 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
| public class BlockingQueue implements Queue { | |
| private java.util.Queue queue = new java.util.LinkedList(); | |
| /** | |
| * Make a blocking Dequeue call so that we'll only return when the queue has | |
| * something on it, otherwise we'll wait until something is put on it. | |
| * | |
| * @returns This will return null if the thread wait() call is interrupted. | |
| */ |
This file contains hidden or 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
| public class MyWorker extends Thread { | |
| private static int instance = 0; | |
| private final Queue<String> queue; | |
| public MyWorker(Queue queue) { | |
| this.queue = queue; | |
| setName("MyWorker:" + (instance++)); | |
| } | |
| @Override |
This file contains hidden or 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
| select CONVERT(DATE,getdate(), 101) -- returns YYYY-MM-DD | |
| /*OR...*/ | |
| select CAST(GETDATE() as Date) -- returns YYYY-MM-DD |
This file contains hidden or 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
| with cte as ( | |
| select row_number() over ( | |
| partition by | |
| $column_names$ | |
| order by $orderby_column$ as rn | |
| from $table_name$) | |
| delete from cte | |
| where rn > 1; |
This file contains hidden or 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
| //Synchronous: | |
| var fs = require('fs'); | |
| var array = fs.readFileSync('file.txt').toString().split("\n").forEach(function(line){ | |
| console.log(line); | |
| }); | |
| //Asynchronous: | |
| var fs = require('fs'); | |
| fs.readFile('file.txt', function(err, data) { | |
| if(err) throw err; |